{extend name="./theme/backend/base.html"}
{block name="content"}
<script>
	$(function(){
		$("[data-toggle='tooltip']").tooltip();
	});
</script>

<style type="text/css">
	.selector{width: 120px;}
</style>

<div class="wrap js-check-wrap">
	<ul class="nav nav-tabs">
		<!-- <li class="active"><a href="javascript:void(0)">用户信息</a></li> -->
		<li class="active"><a href="{:url('cms/UserConsultManage/index', ['form_id'=>input('form_id')])}">用户信息</a></li>
	</ul>
	<form class="well form-search" method="get" action="">
		<input type="hidden" name="act" value="search" />
		<input type="hidden" name="form_id" value="{:input('form_id')}">
		<!-- <select name="ischeck" class="selector ischeck">
			<option value="">审核状态</option>
			<option value="0">未审核</option>
			<option value="1">已审核</option>
		</select> &nbsp;&nbsp; -->
		<!-- 时间：
		<input type="text" name="start_time" class="js-datetime date" value="{$search.start_time|default=''}" style="width: 120px;" autocomplete="off">-
		<input type="text" class="js-datetime date" name="end_time" value="{$search.end_time|default=''}" style="width: 120px;" autocomplete="off"> &nbsp; &nbsp; -->
		关键字： 
		<input type="text" name="keyword" style="width: 200px;margin-bottom: 0px;" value="{$Think.get.keyword|default=''}" placeholder="请输入关键字...">
		<input type="submit" class="btn btn-primary" value="搜索">
		<a class="btn btn-danger" href="{:url('cms/UserConsultManage/index', ['form_id'=>input('form_id')])}">清空</a>
		<a class="btn btn-info" href="{:url('cms/UserConsultManage/export', ['form_id'=>input('form_id')])}" target="_blank">导出</a>
	</form>

	<form method="post" class="js-ajax-form" action="term/listorders">
		<input type="hidden" name="form_id" value="{:input('form_id')}">
		<div class="table-actions">
            <!-- <button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:url('cms/UserConsultManage/check',['ischeck'=>1])}" data-subcheck="true">审核
            </button>
            <button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:url('cms/UserConsultManage/check',['ischeck'=>0])}" data-subcheck="true">取消审核
            </button> -->
            <button class="btn btn-danger btn-small js-ajax-submit" type="submit" data-action="{:url('cms/UserConsultManage/del')}" data-subcheck="true" data-msg="您确定删除吗？">删除</button>
        </div>
		<table class="table table-hover table-bordered table-list">
			<thead>
				<tr>
					<th width="15">
						<input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
					</th>
					<th width="10">ID</th>
					<th>用户昵称</th>
					<th>头像</th>
					<th>用户等级</th>

					{volist name="fields" id="field"}
						<th>{$field.title}</th>
					{/volist}

					<th width="80">操作</th>
				</tr>
			</thead>
			<tbody>
				{empty name="list"}
				<td colspan="12">没有数据</td>
				{else/}
				{foreach name="list" item="vo"}
				<tr>
					<td>
						<input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="id[]" value="{$vo.id}" title="ID:{$vo.id}">
					</td>
					<td>{$vo.id}</td>
					<td>{$vo.nickname}</td>
					<td>
						{empty name="vo.headimg"}
							<i class="fa fa-close fa-fw"></i>
						{else/}
							<img src="{$vo.headimg}" style="max-height:80px;max-width:100px;margin:auto;"/>
						{/empty}
					</td>
					<td>{$vo.level_text}</td>

					{volist name="fields" id="field"}
						<td>{$vo[$field['name']]}</td>
					{/volist}

					<td>
						<a href="javascript:;" data-url="{:url('cms/UserConsultManage/sview',['id'=>$vo['id'], 'form_id'=>input('form_id')])}" class="layer-edit" data-title="查看">查看</a> |
						<a href="{:url('cms/UserConsultManage/edit',['uid'=>$vo['uid'], 'form_id'=>input('form_id')])}">修改</a>
						<!-- <a href="{:url('cms/UserConsultManage/del',['id'=>$vo['id']])}" class="js-ajax-delete">删除</a> -->
					</td>
				</tr>
				{/foreach}
				{/empty}
			</tbody>
		</table>

		{notempty name="list"}
			<div class="pagination text-center">{$list->render()}</div>
		{/notempty}
	</form>
</div>

<script src="{$admin_assets_path}/js/common.js"></script>
<script type="text/javascript">
	$(".ischeck").val("{$search.ischeck|default=''}");
</script>
{/block}